import 'package:flutter/material.dart';

main()=>runApp(MyApp());

class MyApp extends StatelessWidget{
  Widget build(BuildContext context){
    return MaterialApp(

      home: Scaffold(
        appBar: AppBar(
          title: Text("布局练习"),
        ),
        body:_LayouDemo(Colors.green,borderSize:1), 
      ));
    }
  }

class _LayouDemo extends StatelessWidget{
  Color color = Colors.red;
  double borderSize = 1;
  _LayouDemo(this.color,{this.borderSize});
    Widget build(BuildContext context){
      return Center(
        child:Stack(
          alignment: Alignment(0,-1),
          children: <Widget>[
            Container(
              decoration: BoxDecoration(
                  color: this.color,
                  border: Border.all(
                    width: this.borderSize,
                  )
              ),
              height: 400,
              width: 300,
              
            ),
            Text("这个是文本111"),
            Text("22222")
          ],
      ));
    }
}